package com.chief;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import org.apache.dubbo.config.annotation.DubboService;

@DubboService
public class SentinelServiceImpl implements SentinelService {

    @SentinelResource(value = "test", blockHandler = "exceptionHandler")
    @Override
    public String test() {
        return "sssss";
    }


    public String exceptionHandler(BlockException ex) {
        ex.printStackTrace();
        return "请求过于频繁";
    }
}
